<template>
    <div>
        <el-form>
            <el-form-item>
                <el-input v-model="value" resize="none" :rows="10" type="textarea" style="text-align: left;font-size: 16px;"
                    placeholder="请换行输入原译文句对，支持多组原译句对同时导入，例如:
                你好
                hi"></el-input>
            </el-form-item>
            <el-form-item>
                <div class="upload-tips flex-column" style="font-size: 12px;color:#666">
                    <div> 上传双语对照文件，请下载并使用如下模板：
                    </div>
                    <div> 上传单语文件，请下载并使用如下模板： </div>
                    <el-button type="text" @click="dialogTableVisible = true">跳过</el-button>
                </div>
            </el-form-item>

        </el-form>
        <div style="text-align: right;">
            <el-button @click="router.go(-1)">取消</el-button>
            <el-button type="primary" @click="dialogTableVisible = true">下一步</el-button>
        </div>
    </div>
    <el-dialog v-model="dialogTableVisible" width="30%" :title="`${currentRoute.query.type === 'term-libs' ? '术语库' : '记忆库'}基本信息`">
        <el-form label-width="60px">
            <el-form-item label="名称" required>
                <el-input v-model="formInline.one" placeholder="名称" />
            </el-form-item>
            <el-form-item label="语言" required>
                <el-input v-model="formInline.two" placeholder="语言" />
            </el-form-item>
            <el-form-item label="领域" required>
                <el-select v-model="formInline.three" placeholder="请选择">
                    <el-option v-for="item of fieldlist" :key="item.name['en-US']" :label="item.name['zh-CN']"
                        :value="item.name['en-US']" />
                </el-select>
            </el-form-item>
            <el-form-item label="备注">
                <el-input v-model="formInline.four" placeholder="请输入备注" />
            </el-form-item>

        </el-form>

        <template #footer>
      <span class="dialog-footer">
        <el-button @click="dialogTableVisible = false">取消</el-button>
        <el-button type="primary" @click="dialogTableVisible = false">
          确定
        </el-button>
      </span>
    </template>
    </el-dialog>
</template>

<script setup lang="ts">
import { ref } from 'vue';
import { listObject } from '@/utils/languagelist'
import { useRouter } from 'vue-router';
let router = useRouter()
let currentRoute = router.currentRoute.value
console.log(router.currentRoute.value)
const value = ref('');
const dialogTableVisible = ref<boolean>(false)
const formInline = ref({
    one: '',
    two: '',
    three: 'IT Technology',
    four: '',
})
const fieldlist = listObject.fieldlist.map((item => {
    return {
        ...item,
        name: JSON.parse(item.name)
    }
}))
</script>

<style scoped></style>